package com.zhang.hadoop.spring.checker;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Arrays;

/**
 * @author zhang yufei
 * @date 2022/6/28 18:31
 **/
@Service
@Valid
public class CheckerBusiness {

    public void add(@Valid @NotNull(message = "对象不能为空") UserBO bo, UserBO bo1) throws Exception {

        ValidatorUtil.validate(bo);
        ValidatorUtil.validate(bo1);
        System.out.println(JSONObject.toJSON(bo));
    }
}
